<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>毕业论文管理系统</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<link rel="shortcut icon"
	href="${pageContext.request.contextPath }/favicon.ico"
	type="${pageContext.request.contextPath }/image/x-icon" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/css/font.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/css/xadmin.css">
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery-3.3.1.min.js"></script>
<script src="${pageContext.request.contextPath }/lib/layui/layui.js"
	charset="utf-8"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/xadmin.js"></script>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
	<div class="x-body">
		<fieldset class="layui-elem-field">
			<legend>学生选题情况</legend>
			<c:choose>
				<c:when test="${!empty studentList }">
			<table class="layui-table" style="width: 96%; margin: 2%">
				<thead>
					<tr>
						<th>名字</th>
						<th>学号</th>
						<th>论文标题</th>
						<th>进度</th>
				</thead>
				<tbody>
				<c:forEach items="${studentList }" var="student">	
					<tr>
						<td>${student.name }</td>
						<td>${student.no }</td>
						<td><input type="text" name="title" value="${student.choose_topic.title }"
							autocomplete="off" class="layui-input"></td>
						<td>${student.status }</td>
					</tr>
				</c:forEach>
				</tbody>
			</table>
			</c:when>
				<c:otherwise>
					你尚未分组
				</c:otherwise>
			</c:choose>
			<button style="margin: 2.5%;width: 95%;margin-top: 0.8%" onclick="pass('${teacher.no}')" class="layui-btn layui-btn-normal layui-btn-fluid">提交审核</button>
		</fieldset>
	</div>
</body>
<script>
function pass(teacher_no){
	$.ajax({
		url : "${pageContext.request.contextPath }/teacher/passTopic.do",
		type : "post", 
		data : JSON.stringify({teacher_no:teacher_no}),
		contentType : "application/json;charset=UTF-8",
		dataType : "json",
		//成功响应的结果
		success : function(data){
			if(data != null){					
				layer.msg(data.msg,{time:2000});
			}
		}
  	}); 
}
</script>
</html>